[Top] [Prev] [Next] [Bottom]
[Contents]
Sapphire/Web Projects
Overview
A Sapphire/Web-generated project consists of at least a project file, two or more HTML files, a main C/C++ file, a make file, and one or more HTML-related C/C++ module files. As you add HTML files with the document manager, they become part of your project. These HTML files can be used as either HTML templates, HTML activators, or both.
If a Form or Anchor in an HTML file has been bound as an Activator in a project, then an HTML-related C/C++ module will be created and added to the project. This file contains a Function for each bound activator in the HTML file, and one Registration Function name for the module containing Registration Calls for the activators in that HTML file. It also contains any registration calls for Aliases to those Activators.
The C/C++ module also contains your globals and includes code section, where other functions can be declared or defined.
The name of the C/C++ module is derived from the name of the HTML file. Therefore, several issues must be considered:
- The module name is derived by removing the last "dot" extension from the HTML filename (if any) and appending ".c" for C mode or your C++ suffix for C++ mode. Because of this rule, it is possible to have a case where the HTML filenames are different but the module names would be the same. For example, the HTML files
products.HTML
and products.txt
would have conflicting module names (products.c
or products.cc
)
- A more stringent consideration for choosing HTML filenames carefully has to do with the Registration Function name mentioned previously. These Registration Functions are C/C++ Function Names and do not have static linkage. The Registration Function name is derived from the HTML file name, so any character that is not an alphanumeric or an underscore in the HTML file name is converted to an underscore.
- An "R_" is prepended to the name. This solves the C/C++ function name issue, but there is more chance for HTML files of different names to produce the same registration function name for module names. For example, the HTML files
scott_prod.html
, scott$prod.html
, and scott-prod.html
will all produce R_scott_prod_html
as the registration function.
- Another consideration is the conflict of HTML file names with other projects. For that reason you should work with only one project in any one directory.
- Finally, if you set your project options to use the same HTML directory for all projects, then you must worry about the HTML file name conflicts across projects. Finally, the main C/C++ file is derived from your project name; here you must watch for conflicts with module names.
- For example, a project,
mark.pj
, and an HTML file, mark.html
, will produce the same main and module names. If you are looking to port to another O/S which has an 8.3 naming limit, then your HTML files will need to be named accordingly. - Note It is suggested that you name all your HTML files with a standard extension, for example, "
.html
" or ".htm
". This will make it easier to manage, find, and query them in your file system. Limit the characters in the name to alphanumeric characters and the underscore.
Creating Projects
The Client Libraries
The client library for a Sapphire/Web Server Application is libwebdb.a
. If you choose the non-gateway version (see sachmake.sh
) you will use libwebdbSY.a, libwebdbOR.a
, or libwebdbIF.a,
depending on which database vendor you use. These vendor-specific client libraries depend on the database vendor's library. These client libraries do not have any dependency on X or Motif (this keeps the CGI efficient). The API and the client libraries can be used to build stand-alone, command-line driven executables.
In the config directory of the Sapphire/Web distribution is a file Makefile.tem
. This file is used to generate the Server Application's makefile whenever you save your project. You can choose three modes of compilation: KR-C, ANSI C, and C++. Each has its own compile and link flags and options. You should make the appropriate changes for your developers during the tool setup, if needed. The Sapphire/Web client libraries are compiled with C linkage with the appropriate declarations for C or C++ in the headers.
During the operation of Sapphire/Web, a variety of shell scripts are called. This is your opportunity to customize the tool. You can add source code control, change the HTML browser, or editor by changing these scripts. See Chapter 7, "Project Options", for the various shell scripts.
[Top] [Prev] [Next] [Bottom]
[Contents]
info@bluestone.com
Copyright © 1997, Bluestone. All rights
reserved.